package NWish.properties
{
	import NWish.FileSystem;
	import NWish.Interface.ILogger;
	import NWish.json.OrderDict;
	import NWish.properties.Properties;
	
	import away3d.loaders.parsers.*;
	
	
	public class FileProperties
	{
		private var _app;
		private var _extraFileName;
		private var _fileExtras;
		
		public function FileProperties(app,extraFileName:String,fileExtras:Array)
		{
			_app = app;
			_extraFileName = extraFileName;
			_fileExtras = fileExtras
		}
		
		public function get fileSystem()
		{
			if(_app)
				return _app.getPlugin('FileSystem');
		}
		
		public function propertiesToDict(obj,dict:OrderDict,read_only,saving = false)
		{
			if(read_only == false)
			{
				if(saving == false)
				{
					if(obj.extra)
						dict.push(Properties.readMark + 'file', obj.extra[_extraFileName]);
					else
					{
						dict.push('file', '');
						var files = fileSystem.getFileNames(_fileExtras);
						dict.push(Properties.readMark + 'files', files);
					}
				}
				else
				{
					dict.push('file', obj.extra.meshFileName);
				}
			}
		}
		
		public function dictToProperties(dict,obj,scene,isloading)
		{
		}
		
	}

}